<?php
 include "counter.php";
?>
<?php pagestart();
pagehead("Coding Standards");
?>
<BODY bgcolor="white">
<?php pagetop("Coding Standards") ?>

The Linux Counter isn't very formal about coding. But people need to
know some things.

<h2>Perl standards</h2>
The update functions of the counter are written in Perl. They use the
homebrew module "FileTable.pm" for data access - mostly through the
"Counter.pm" module. Do NOT update data in the DB outside this module!

<h2>PHP standards</h2>
The counter wants to move towards having all display pages in PHP.
<p>
These should be based on "phpinc/sample.php", which will give you the
right header and footer.
<p>
The counter uses PHP sessions.
<p>
The counter should work with "register_globals" off. Use the data
accessor functions in counter.php to get at data, NOT globvars!

<h3>Internationalization</h3>
The counter wants to be internationalized - this is a long battle.<p>
At the moment, the easy way to do it is to first write a page in
English in the standard counter, and then run the script
"tools/internationalizewebpage" to generate a page in the
internationalized version of the site. Then one needs to generate a
new .po file, and have that translated (Patrick knows this one well).
<p>
Sooner or later, we'll have to change to working with the
internationalized files.

<h3>State handling - EXPERIMENTAL</h3>
State is done with two variables in the session:
<ul>
<li>showpage - set by any script that control should return to after
an action is done
<li>message - displayed by any "return-to" page
</ul>
A Perl CGI script should do its work, set "message" if there's any
error or other thing to tell the user, and redirect the user back to
"showpage".
<p>
If an error display page is needed for complex errors (or things not
coded to this standard), this error display does NOT set "showpage".
<p>
If "showpage" is not set, and the user is logged in, control returns
to "/person/".
<p>
If "showpage" is not set, and the user is NOT logged in, control
returns to "/".
<p>
The standard coding for this in a PHP page is to call "iamashowpage()" just
after "php include counter.php", and to call "showmessage() just after
calling "pagetop()". Both functions are defined in counter.php.

<?php pagebottom("yes") ?>
</body>
</html>


